package com.jyw.router.hospital.domain.vo;

import com.jyw.router.common.utils.DateUtils;
import com.jyw.router.hospital.domain.WxUser;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @author 沈峻
 * @ClassName LoginMiniappVo
 * @Description TODO
 * @Date 2023/4/19 12:01
 **/
@Data
@ApiModel("小程序登录请求实体")
public class LoginMiniappVo {

    @ApiModelProperty("用户号码")
    private String phone;

    @ApiModelProperty("小程序code")
    private String code;

    @ApiModelProperty("小程序唯一标识")
    private String openId;

    @ApiModelProperty("开放平台唯一标识")
    private String unionId;

    @ApiModelProperty("无码报修医院标识")
    private String hospitalId;

    public WxUser buildWxUser() {
        WxUser user = new WxUser();
        user.setPhone(getPhone());
        user.setMiniappOpenId(getOpenId());
        user.setUnionId(getUnionId());
        user.setCreateTime(DateUtils.getNowDate());
        user.setSubscribe(0);
        return user;
    }
}
